<?php

// +----------------------------------------------------------------------
// | H1CMS © OpenSource CMS
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2016 http://www.h1cms.com All rights reserved.
// | Copyright (c) 2014-2016 嘉兴领格信息技术有限公司，并保留所有权利。
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Allen <allen@lg4.cn>
// +----------------------------------------------------------------------

namespace Lg\View;

/**
 * Description of Data
 *
 * @author getssl
 */
class Data {

    public static $_data = [];

    public static function with($key, $value = null) {
        if (is_array($key)) {
            static::$_data = array_merge(static::$_data, $key);
        } else {
            static::$_data[$key] = $value;
        }
    }

    public static function set($key, $value) {
        static::$_data[$key] = $value;
    }

    public static function get($key) {
        if (isset(static::$_data[$key])) {
            return static::$_data[$key];
        }
        return NULL;
    }

    public static function has($key) {
        return array_key_exists($key, static::$_data);
    }

}
